package wec_wallet.ebo.com.utils;

import android.app.Activity;

import java.util.HashMap;
import java.util.Map;

import bassproject.ebo.com.ebobass.http_utils.interfaces.IHttpPostListener;
import bassproject.ebo.com.ebobass.utils.IDeviceId;
import bassproject.ebo.com.ebobass.utils.Lg;
import bassproject.ebo.com.ebobass.utils.StringUtil;

/**
 * Created by admin on 2018/3/29.
 */

public class PubRequest {

    public static boolean login(Activity context, String ip, String phone, String password, IHttpPostListener postListener, boolean showLoading) {

        Lg.d("login ip="+ip);
        //发送协议
        Map<String, Object> postParams = new HashMap<String, Object>();
        postParams.put("mobile", phone);
        postParams.put("password", password);
        if(!StringUtil.isEmpty(ip)){     postParams.put("ip", ip);}

        postParams.put("equipment_id", IDeviceId.getDeviceID());
        Functions.post(context, URLs.LOGIN, postParams, postListener, showLoading, true);
        return true;
    }
}
